
By Eric Bennett,
ericb@pobox.com
Please send me email to report any errors in this document (technical, grammatical, or other).
The correct address of MacSlack's Internet web page is
http://www.pobox.com/~ericb/software/macslack/.
Other
addresses may change without notice.
Table of Contents
What is MacSlack?
MacSlack is a freeware drag-and-drop application that calculates how much slack space is present in a given set of files.
It can also predict how much hard drive space you will regain if you split your hard disk into more partitions or
convert volumes in the standard format (HFS) to the new, more efficient format (HFS+) introduced in MacOS 8.1.
If you already know why slack space is bad and how to get rid of it, you can skip down to
"How do I use MacSlack?"
What is "slack space?"
In order to keep efficient track of the files on your hard drive, your Macintosh has to split the available space
on your drive into chunks ("clusters") of manageable size, as shown in Figure 1 below (white represents
free space). The Macintosh can then keep track of which of these large clusters each file on your drive occupies.

The standard Macintosh filesystem (called HFS, for "Hierarchical FileSystem") can keep track of 65,536 cluster on any given volume.
(A volume is a file storage area on a hard disk; most computers only have one large volume per
hard disk, but you can split the disk into several small volumes instead.) On larger volumes, this
means that the size of each cluster has to be larger.
Dividing the drive into large clusters as in Figure 1 usually results in wasted space. Suppose that you have a
file that is 2460 characters (bytes) long, and your cluster size is 1024 bytes (such a situation is depicted for the yellow
file in Figure 2 below). The Macintosh must allocate three clusters (totalling 3072 bytes) for this file even
though only 2460 bytes are used. The remainder of the third cluster, called slack space, is wasted. Note that all 14
clusters in Figure 2 contain file data (represented by color); there are no free clusters, so no new files can be created on
this area of the disk.

This wasted space can be a serious problem on large drives with lots of small files: the larger the drive, the larger the
cluster size, and the smaller the files, the greater the amount of wasted space in each file's last cluster. If you decreased the
size of the partitions on your hard drive (by splitting large partitions into multiple smaller ones), the
clusters on each drive would be smaller, and you could reclaim
some of the wasted space. For example, you might split the partition in Figure 2 into two smaller partitions so that the cluster size
was only 512 bytes (as in Figure 3). The yellow file would take five clusters totalling 2560 bytes.

There would still be 100 wasted bytes, but 512 of the bytes that were wasted in Figure 2 are now a free cluster, which
can hold a new file. On large partitions, where the cluster size can reach 32,000 bytes or more,
you can lose a significant amount of space. A friend of mine discovered last year that his Windows 95 system was
wasting 28% of the space on his drive for exactly this reason (the common DOS/Windows "FAT16" filesystem
has the same 65,536 clusters-per-volume limit that the Mac does). The main hard drive on my own computer has one
four gigabyte partition, and 25% of the space allocated to files is slack space.
How do I eliminate slack space on a Macintosh?
You can't get rid of slack space entirely. Most hard drives enforce a minimum cluster size of 512 bytes, so a 1 byte file
will always be wasting the majority of the space allocated to it. However, if you can decrease the cluster size
so that it is closer to 512 bytes, you will waste less space.
There are, in theory, two ways to reduce the cluster size. Each has its drawbacks. MacSlack should help you
decide whether the space savings you're likely to see make it worthwhile to deal with the drawbacks.
Method 1: Use a New Volume Format
First, you can change to a different way of storing
files that doesn't limit you to 65,536 clusters per disk. Operating systems that support volumes with higher
limits include Windows NT, the most recent revision of Windows 95 (but not the original release), and Unix. MacOS
joined this list in January, 1998, with the release of MacOS 8.1, which includes a new volume
format called HFS+ (also known as "MacOS Extended Format" or "Sequoia"). The new format increases the maximum number
of clusters from 65 thousand to 4 billion. The MacOS Finder can create volumes that
use this format, and most third party disk formatters will be updated to support it as well.
Figure 4 below shows the actual change in disk use for an 8.4 gigabyte partition that was converted
from HFS to HFS+. Note the change in the "Format" information; the left window shows the drive in Standard
(HFS) format, and the right window shows Extended (HFS+) format:

Under HFS, the 4,161 items used 952 megabytes; under HFS+, they use 443. Thus, 509 megabytes were regained.
But there are potential problems with changing a drive to HFS+:
- MacOS 8.1 requires you to reformat your hard disk to convert it to the new format. Reformatting erases the hard disk, so you must to back up your files first.
Alternatively, Alsoft has announced a $20 program that will convert volumes without requiring a reformat; if
you are connected to the Internet, you can read a MacWeek
article about the software.
- Splitting the drive into more blocks means there is more bookkeeping information to store on the disk. This
requires more disk space and also slows the computer down somewhat. MacOS 8.1 also creates HFS+ volumes
as an HFS+ disk image file stored on an HFS volume. (The HFS volume contains two files of interest: (1) an HFS+ disk image, which is what
you see under MacOS 8.1, and (2) a readme file which explains to users of previous MacOS releases that the main
contents of the disk can only be read in MacOS 8.1 or newer. If this sounds confusing, think of HFS+ as a novel written in Russian,
and think of the readme file as a note in English at the beginning that says, "You need to learn Russian to
access the rest of this book.") This extra HFS volume also has its own
bookkeeping information. However, the additional space these items use is
small compared to the space that is otherwise regained on a large disk. For example, for Figure 4, MacSlack predicted a savings of
522 megabytes, which was 13 megabytes higher than the 509 megabytes that were actually recovered.
- Any Macintosh running MacOS 8.0 or earlier will not be able to read the disk except that, as mentioned above,
it will be able to display a readme file explaining that the main disk contents cannot be read in MacOS 8.0 or
earlier. Third-party products or future MacOS releases may do away with the HFS "wrapper" volume altogether;
such HFS+ volumes would be completely unreadable on Macintoshes with OS 8.0 or earlier.
- If your Macintosh does not have a PowerPC processor, it will not be able to boot from an HFS+ volume or
store a virtual memory file on it.
- Low-level disk utilities such as disk optimizers and disk repair software need to
be rewritten to support HFS+. Before you change to HFS+, you may wish to check with your disk utility vendors
to see whether updated software is available.
Method 2: Split Your Hard Disk Into More Partitions
Second, you can split large partitions into multiple smaller partitions. You can accomplish this with Apple HDSC Setup,
Apple Drive Setup, or a third party disk formatter (examples include Hard Disk Toolkit, Silverlining, and Anubis).
Since the cluster size must always be a multiple of 512 bytes, and
since there are a maximum of 65,536 clusters under HFS, you can
calculate the following table:
Partition Size
(megabytes) |
Cluster Size
(bytes) |
1-32 |
512 |
33-64 |
1024 |
65-96 |
1536 |
97-128 |
2048 |
129-160 |
2560 |
161-192 |
3072 |
193-224 |
3584 |
225-256 |
4096 |
etc... |
As you can see, the cluster size increases by 512 bytes for every 32 megabytes of partition size. If you decide to
repartition your hard drive, consider this: as you can see in Figure 2, the green file
has more total wasted space than the blue file, but since it is a big file, it is a smaller percentage of space wasted than the
blue file. Therefore, when creating new partitions, it is a good idea to make one small partition to hold
a large number of small files, while keeping one larger partition for a smaller number of large files. You could also
simply make a large number of small partitions, but it then becomes more difficult to manage files (suddenly you
have more free space, but it is spread around multiple partitions) and your desktop becomes more cluttered.
There are two additional drawbacks to repartitioning:
- It requires reformatting your hard drive, which is inconvenient
for many users.
- Each partition has its own bookkeeping information,
and this information consumes disk space (you lose some of the space that you would otherwise have regained by
partitioning).
Sometimes the space savings of multiple partitions makes these drawbacks seem unimportant; in other
cases these drawbacks are rather serious.
How do I use MacSlack?
Basic Operation
Drag-and-drop disks, folders, files, or a mixture of the three onto the MacSlack application. It will
immediately begin to calculate the total amount of space wasted as well as the percentage of the
used space that is wasted (the white space in Figure 2). You can reset the statistics or cancel the
file scan using the commands in the "Operations" menu. The "Edit" menu contains a "Copy statistics to
clipboard" command, which should be self-explanatory.
While the usual procedure is to drop your hard disk icon onto MacSlack, you
can also calculate slack for any group of files, folders, or volumes. If you find a volume that has a lot of
wasted space, you might want to inspect some of the folders on that volume individually to see whether one of
them is responsible for most of the waste. If so, you may simply be able to move that directory to another, smaller
drive (if you have one) and not have to repartition the entire disk.
As MacSlack is scanning folders that you explicitly told it to scan, it may encounter subfolders inside those
folders. You can tell MacSlack to ignore any subfolders it
encounters by un-checking the "Scan nested folders" item in the "File" menu.
There is a rudimentary help window available in the help menu (also known as
the balloon help menu), but this manual is more detailed.
If You Can't Drag And Drop
Some users have not been able to drag-and-drop files onto MacFile's Finder icon. In most cases, this means
that the computer has not correctly recognized that you have a new program. You should be able to
solve this problem by rebuilding the desktop file. To do so, reboot your computer, and simultaneously hold
down the command (open Apple) and option keys just before the Finder and desktop appear. The Finder will ask you if you
wish to rebuild the desktop file.
If rebuilding the desktop does not work, please contact me by email.
Predicting Space Savings
MacSlack can estimate how much space you would save by repartitioning your hard disk or converting your
disk to HFS+ format (it does not actually perform either of these tasks). If you
are interested in this information, you need to configure MacSlack before
you start to scan files. Choose "Configure predictor..." from
the File menu. The following window will appear:

You need to decide what type of volume you would like to use to predict space
savings:
- Do you want to determine how much space smaller partitions would reclaim? What size volume do you want to test?
- Do you want to use the new HFS+ filesystem (only available in MacOS 8.1 or newer) or the older HFS format?
Once you have chosen the size and type of volume to use, MacSlack needs to know the volume's cluster size.
- If you know the cluster size already, you can enter it directly in the
"Cluster size in megabytes" box. Cluster sizes are always an integral multiple of 0.5 kilobytes.
- If you do not know the cluster size, MacSlack can
calculate it for you. Click on the type of volume you are interested in (HFS or HFS+) and
type the size of the drive in megabytes in the "Volume size in megabytes" box. Then click the
"Calculate cluster size" button.
To make predictions based on the new cluster size, click the "Accept Current Cluster Size" button. If you decide
not to change to a new size, press "Cancel."
After you have set the desired cluster size, drag and drop the desired files and folders onto the MacSlack icon in the
Finder. MacSlack will predict how much space the files would occupy on the type of volume you chose. Because of the
drawbacks mentioned earlier (see How do I eliminate slack space on a Macintosh?), changing to
HFS+ or repartitioning your drive will not release quite as much space as MacSlack predicts. In most situations, however,
the savings should be within a few megabytes of what MacSlack predicts.
Technical Asides
There is one final note for users interested in the details of HFS+. As the settings picture above states, MacSlack
uses the Apple default cluster sizes for calculating HFS+ cluster sizes.
Finder-formatted HFS+ volumes up to 256 MB use 0.5k clusters, volumes from 257-512 MB use 1k, volumes from
512-1 GB use 2k, and any larger volumes use 4k. Although HFS+ would allow
0.5k clusters even on volumes exceeding 1 GB, Apple decided that the increased overhead of dealing with huge
numbers of tiny clusters is not likely to be worth the space savings. However, some third party disk formatting programs
will probably be updated to allow you to choose settings other than the Apple defaults. If you have an Internet
connection and are interested about the other benefits HFS+ will offer, you can
read
Apple's description of HFS+ online. (This article is the original statement of cluster sizes from Apple, including
the no-longer-correct 0.5k size for 256 meg or smaller volumes.)
Also, note that Apple defines
a megabyte as 1024 kilobytes and a gigabyte as 1024 megabytes (1,073,741,842 bytes), while most hard disk manufacturers
define a megabyte as 1,000,000 bytes and a gigabyte as 1,000,000,000 bytes. MacSlack uses Apple's definition because it
more accurately reflects the sizes you will see displayed by the Finder.
Silly Asides
To prevent someone from sending me email asking why I named a hard drive (see Figure 4) after
the CEO of Be, Inc., I will state here that it's because I think he's a cool guy who adding some
much-needed competition to the OS market. My other drives
are "Steve" and "Linus" (you figure it out :-).
Where do I get MacSlack? Are there known problems with it?
Current Version and Distribution
The current version of MacSlack is 1.0. See the version history (below) for changes
in this release.
You may redistribute the original, unmodified MacSlack archive, provided that you do not charge for
this service (media and duplication costs excepted). You may not distribute MacSlack except as just described.
MacSlack can be obtained from the Info-Mac archives or from the author's web site.
The MacSlack 1.0 distribution
(click to download) is
250k. Please send any bug reports or suggestions to my email address, EricB@pobox.com.
Limitations and Requirements
MacSlack has the following limitations and requirements:
- System 7.0 or newer is required.
- 500k of free memory are required.
- MacSlack does not save your preferences when it quits.
- MacSlack can keep track of up to 10,000 folders. If there are more than 10,000 folders waiting
to be scanned, MacSlack will print a warning and skip any additional folders that it encounters. If you
get this message, rest assured that you have a really strange folder structure on your hard drive.
There are currently no known bugs in MacSlack 1.0. The version history for MacSlack is:
- 1.0 : First full release. Calculator now rejects stupid volume sizes (for example, -300 megabytes;
stupid cluster sizes were already rejected in previous versions).
Includes this updated documentation. January 23, 1998.
- 1.0b5: Added an edit menu command to copy the current report to the clipboard (command-K). Configure
Predictor has changed to command-P. January 19, 1998.
- 1.0b4: The calculations are now automatically reset when the Predictor settings are changed. The BNDL
resource was missing from b3 as posted online; it's back in b4. January 14, 1998.
- 1.0b3: Flickering in the log window is reduced, the Close Window command is now available when it should
be and not when it should not be, initial Predictor setting changes are remebered upon subsequent visits to
the configuration window, and you can now close windows or quit during a scan without having to abort the scan.
January 10, 1998.
- 1.0b2: Added ability to predict space savings for different volume setups. January 8, 1998.
- 1.0b1: First release. November 3, 1996.
This information was last modified on January 20, 1998.